import React,{Component} from "react";

import {Redirect} from 'react-router-dom'

export default (WarpComponent:any)=>{
    return class extends Component{
        render(){
            const token = sessionStorage.token
            if(!token){
                return <Redirect from='/' to='/login'/>
            }
            return <WarpComponent {...this.props}/>
        }
    }
}